package com.beyond.market.cart.service.impl;

import com.beyond.market.cart.dao.CartMapper;
import com.beyond.market.cart.domain.Cart;
import com.beyond.market.cart.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;

@Service
public class CartServiceImpl implements CartService {

    @Autowired(required = false)
    private CartMapper cartMapper;

    @Override
    public int update(Integer cartId) throws SQLException {
        return cartMapper.update(cartId);
    }

    @Override
    public Cart getByPrimaryKey(Integer cartId) throws SQLException {
        return cartMapper.getByPrimaryKey(cartId);
    }

    @Override
    public int remove(Integer id) throws SQLException {
        return cartMapper.remove(id);
    }

    @Override
    public Cart getById(Integer id) throws SQLException {
        return cartMapper.getById(id);
    }
    @Override
    public int save(Cart cart) throws SQLException {
        return cartMapper.save(cart);
    }
}
